docs(platform-objects): make the vitest alias rationale independent of a suite count - #16188
Conversation
…f a suite count The alias comment named `managed-api-method-affordance-sweep.test.ts` (#7934) as "the only suite here that imports a sibling package as a VALUE". That licensed a removal it no longer justified: four suites in this package import `@objectstack/lint` as a value, and on the sentence's literal reading (any sibling package) the count is far higher still. Replace the enumeration with the mechanism — the entry is keyed on the SPECIFIER, so it governs whatever set imports it, and `check:test-source-alias` is the thing that decides whether the entry may go. A rationale with no count in it cannot go stale the way this one did. The alias entry itself is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
📓 Docs Drift Check
What this run could not see
Coarse fallback — 2 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
Cross-link: the out-of-scope finding named in this PR's last section is now filed as #16189 — the trailing Generated by Claude Code |
Ready to release — held only by a tooling channel, not by anything in this PRRecording this once rather than leaving the draft state unexplained. All three landing
⛔ The one remaining step — marking the PR ready for review — is only reachable through the ⇒ Nothing is wrong with this branch. The PM seat will retry on each check-in until it goes Generated by Claude Code |
Fixes #16081
What was wrong
packages/platform-objects/vitest.config.tsjustified its@objectstack/lintaliaswith a count:
That sentence licenses a removal it no longer justifies: a future author trimming test
config on the strength of "the only suite" could delete the entry after deleting or
rewriting one test, and take the other importers down with it. The failure mode is
quiet — the suites resolve to
lint/distinstead oflint/srcand keep reporting onbuild state.
Re-measured on today's
main(4e090ecde), by text, not by line numberValue imports of
@objectstack/lintunderpackages/platform-objects— 4, not 1:src/managed-api-method-affordance-sweep.test.tsMANAGED_API_METHOD_UNAFFORDABLE,validateManagedApiMethodssrc/identity/sys-user-preference.organization-unique.test.tslintUnscopedDeclaredIndexes,UNIQUE_UNSCOPED_DECLARED_INDEXsrc/pages/canonical-expression-envelopes.test.tsauditPageExpressionEnvelopes,renderBareExpressionFindingssrc/audit/sys-email.highlight-fields-resolve.test.tsrunRuntimeAuthoringRulesClassified, not bare-grepped. Type-only imports are erased before resolution and need no
alias, so counting them would make the correction wrong in the other direction. Both
type-only detectors return 0 inside
packages/platform-objectsand both fireelsewhere on the same corpus and the same command —
import typeatpackages/cli/src/lint/score.ts:20, inlinetypespecifier atpackages/cli/test/authoring-rule-command-parity.test.ts:31. So the 4 are all values.Pathspec control: plain directory pathspecs throughout (
-- packages/platform-objects),never a
**/glob. The same pathspec reaches 35 suites, 5 of which sit directly insrc/— including the very file the comment named. That is the file class a**/pathspec drops silently.
And on the sentence's literal reading — "a sibling package", not just
@objectstack/lint— the count is far higher still: suites here import@objectstack/spec/*(58 + 22 + 16 + 4 + 2 + 2 + 1 occurrences across its subpaths),@objectstack/metadata-core(3),@objectstack/formula(2) and@objectstack/core(1)as values. So the sentence was false on both readings.
The repair, and why this one
Correcting the count is the most brittle fix available — a fifth suite makes it false
again, and the failure is silent. What went stale is the enumeration, so the version that
survives states the mechanism instead: the entry is keyed on the specifier, so it
governs whatever set imports that specifier, and
pnpm check:test-source-alias— not areading of one test file — is what decides whether the entry may go. A rationale with no
count in it cannot rot the way this one did.
The alias entry itself is untouched, and no test file is touched.
The alias's own necessity — measured, not asserted
The filing card noted the alias's necessity had never been re-measured. It has now been,
by ablation on a committed tree:
find: /^@objectstackcount 1 to 0, injectedalias: [],count 1, blob44dbdea70to5fcc23a2e(not equal to the HEAD blob, so not a no-op edit);pnpm check:test-source-aliasgoes red, naming exactly@objectstack/platform-objects: NEW unaliased artifact import(s) ... @objectstack/lint.That red also proves this package is inside the gate's swept population, so the green
either side is a statement about this package and not about other ones;
44dbdea70and equal to theHEAD blob,
git diff HEADempty across the whole tree,git status --porcelainempty,the removed text back at count 1 and the injected text at count 0;
Independently,
@objectstack/lint'sexports["."]resolves to./dist/index.js, so anunaliased specifier really does land on the build artifact — the premise the surrounding
paragraphs already state. The alias is load-bearing.
The change is behaviourally inert, and that is measured too
The evaluated config is identical either side of the diff. Loading
vitest.config.tsthroughtsxat the base commit4e090ecdeand at this head yieldsbyte-identical normalised objects:
test.disableConsoleIntercept: true, one alias entrywith
find/^@objectstack\/lint$/(flags empty) and the same resolved replacement path.The instrument is proven to discriminate: aimed at a variant whose alias array is emptied,
the same dump differs. So "identical" here is a measurement, not a blind spot.
Verification
pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2atb7f516e8b, after building the dependency closure(
pnpm --filter '@objectstack/platform-objects^...' run build, 8 packages):35 test files passed, 528 tests passed. This is the reading that covers the edited
file, because vitest is what loads it.
pnpm --filter @objectstack/platform-objects typecheck(both programs): green — butit says nothing about the edited file.
tsc --listFilesfindsvitest.config.ts0 times in either program (control:src/index.tsappears 1),because the package tsconfig is
include: ["src/**/*"]and the root tsconfig excludespackagesentirely. Reported as a coverage fact, not as a pass.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(no hand-built path list): 39 runnable families. 36 of 39 green at
b7f516e8b,including
check:test-source-alias,check:published-files,check:nul-bytes,check:i18n-stale-fill,check:system-context-census,check:cross-package-test-inputs,check:doc-authoringand both closing-keyword parity runs.check:dts-closure,check:dual-build-cjs-loadsandcheck:i18neach exited 3 = PREREQUISITE NOT METin their own words ("nothing was swept", "this is NOT a pass"), because they read a
built tree this worktree does not have. They are left to CI, which builds. Narrowing
declared rather than assumed, and this diff is provably outside all three input sets:
nothing in the repo imports
vitest.config.ts(control:app-showcase/vitest.configfires 5 times on the same command), it is not among tsup's 11 declared entries, and the
i18n extract config imports only
../src/**.was checked rather than judged: no file in the tree anchors
packages/platform-objects/vitest.config.ts:LINE. Control: 35 files undercontent/+docs/do carryPATH.ts:LINEanchors, so the instrument fires.Publishing and labels
Clause-2: no. This diff publishes nothing.
@objectstack/platform-objectsdeclaresfiles: ["dist", "README.md", "CHANGELOG.md"];npm pack --dry-runlistsvitest.config.ts0 times (control:package.json1), andcheck:published-filesstates on its pass path that every whitelist "admits no test, test-harness config or
build script". No declaration file, no runtime module and no docs page can move for this
diff. Hence the
skip-changesetlabel rather than a changeset file, per AGENTS.md:that label is for a diff that publishes nothing from any released package.
Not fixed here, deliberately
The trailing comment in the same file still opens
No test block: this package had no vitest config until now, while atestblock withdisableConsoleIntercept: truesitsat the top of the file, and it claims "this file's only effect the alias above". Same
defect class, different sentence, and outside this card's declared surface — filed
separately rather than ridden in on this PR.
Generated by Claude Code